package com.whale.springsession.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.security.core.Authentication;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

@RestController
@PreAuthorize(value = "hasAuthority('Users.Update')")
@RequestMapping("/con1")
public class Controller1 {

    @Value("${server.port}")
    String port;

    @GetMapping
    public String a(HttpServletRequest request, Authentication principal){
        return port + "con1";
    }

}
